<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>客户类型管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {

	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
	//删除
	function deleteData() {
		var $id = $("input[name='id']:checked");
		var ids = new Array();
		var j = 0;
		if ($id.val() != null && $id.val() != '') {
			var submit = function(v, h, f) {
				if (v == 'ok') {
					$id.each(function(i, info) {
						ids[j] = info.value;
						j++;
					});
					resetTip();
					location.href = "${ctx}/pro/clienteleType/deleteData?ids=" + ids;
				} else if (v == 'cancel') {
					return true;
				}
			};
			$.jBox.confirm("确认删除此信息吗？", "提示", submit);
		} else {
			jBox.tip("请勾选需要删除的数据！");
		}
	}
	$(document)
			.ready(
					function() {
						//全选
						$("#checkAll").click(
								function() {
									$('input[name="id"]').attr("checked",
											this.checked);
								});
						var $subBox = $("input[name='id']");
						$subBox
								.click(function() {
									$("#checkAll")
											.attr(
													"checked",
													$subBox.length == $("input[name='id']:checked").length ? true
															: false);
								});
					});
</script>
</head>
<body>
	<div class="container" style="width: 100%;">
		<div style="margin: 20px; border: 1px solid #c8d1d5;">
			<div
				style="padding: 13px; background-color: #f4f4f4; border-bottom: 1px solid #c8d1d5;">
				<h4>
					<i class="icon-globe"></i>客户类型管理
				</h4>
				<ul class="ul-form" style="float: right; margin-top: -25px;">
					<li style="list-style: none"><a class="btn btn-primary"
						href="${ctx}/pro/clienteleType/form"> <i class="icon-pencil"></i>&nbsp;新增
					</a> <a class="btn btn-danger" href="javascript:void(0)"
						onclick="deleteData()"> <i class="icon-trash"></i>&nbsp;删除
					</a></li>
				</ul>
			</div>
			<div style="margin: 17px;">
				<form:form id="searchForm" modelAttribute="clienteleType"
					action="${ctx}/pro/clienteleType/" method="post"
					class="breadcrumb form-search">
					<input id="pageNo" name="pageNo" type="hidden"
						value="${page.pageNo}" />
					<input id="pageSize" name="pageSize" type="hidden"
						value="${page.pageSize}" />
					<ul class="ul-form">
						<li>
						<label style="width: 150px;">客户类型编号：</label> <form:input path="codeNum"
								htmlEscape="false" maxlength="64" class="input-medium" />
						<label>客户类型：</label> <form:input path="name"
								htmlEscape="false" maxlength="64" class="input-medium" /></li>
						<li class="btns"><input id="btnSubmit"
							class="btn btn-primary" type="submit" value="查询" /></li>
						<li class="clearfix"></li>
					</ul>
				</form:form>
				<sys:message content="${message}" />
				<table id="contentTable"
					class="table table-hover table-bordered">
					<thead>
						<tr>
						<th style="width: 8px;"><input type="checkbox"
								class="group-checkable" id="checkAll" /></th>
							<th>客户类型编号</th>
							<th>客户类型</th>
							<th>备注信息</th>
							<th>更新时间</th>
							<shiro:hasPermission name="pro:clienteleType:edit">
								<th>操作</th>
							</shiro:hasPermission>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${page.list}" var="clienteleType">
							<tr>
							<td style="width: 8px;"><input type="checkbox" name="id"
									class="group-checkable" value="${clienteleType.id}" /></td>
								<td>${clienteleType.codeNum}</td>
								<td>${clienteleType.name}</td>
								<td>${clienteleType.remarks}</td>
								<td><fmt:formatDate value="${clienteleType.updateDate}"
										pattern="yyyy-MM-dd HH:mm:ss" /></td>
								<shiro:hasPermission name="pro:clienteleType:edit">
									<td><a
										href="${ctx}/pro/clienteleType/form?id=${clienteleType.id }"><i class="icon-edit"></i></a>
										<a
										href="${ctx}/pro/clienteleType/deleteData?ids=${clienteleType.id }"
										onclick="return confirmx('确认要删除该库位吗？', this.href)"><i class="icon-remove"></i></a></td>
								</shiro:hasPermission>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="pagination">${page}</div>
			</div>
		</div>
	</div>
</body>
</html>